load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "clientinfo",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "lib": {"name": "clientinfo"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-clientinfo",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:rand",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:tracing",
        "//common/rust/shed/hostname:hostname",
    ] + ([] if rust_oss.is_oss_build() else [
        "//devx_www/cross_env_session_id:cross_env_session_id",
    ]),
)
